<?php

namespace App\Models\Mgt;

use Illuminate\Database\Eloquent\Model;
use Laracasts\Presenter\PresentableTrait;

class Sms extends Model  
{
    use PresentableTrait; 

    protected $presenter = 'App\Http\Presenters\Mgt\SmsPresenter';

	const PRODUCT = "Dysmsapi";

    const DOMAIN = "dysmsapi.aliyuncs.com";
        
    const REGION = "cn-hangzhou";

    const VERSION = "2017-05-25";

    const METHOD = "POST";

    const SIGN = '琴岛演艺';

    protected $table = 'mgt_sms';

    protected $guarded = array();

    public $timestamps = false; 

    public function scopeActive($query)
    {
        return $query->where('status', STATUS_NORMAL);
    }


    public function scopeBatch($query)
    {
        return $query->where('is_batch', STATUS_NORMAL);
    }


    public function plans()
    {
        return $this->hasMany('\App\Models\Mgt\Plan')->orderBy('id','desc');
    }
}